package com.sitech.ibnms.c3p.domain;

import com.sitech.ismp.workflow.domain.ProcessInstance;
import com.sitech.ismp.workflow.domain.Task;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by liujhc on 10/10.
 */
public class C3pServerLogTask implements Serializable {
    private int logId;
    private String c3pTaskId;
    private String scheduleId;
    private int execId;
    private int processId;
    private int processExecId;
    private int activityId;
    private int activityExecId;
    private int parentActivityExecId;
    private String currentUser;
    private Date dbTime;
    private String logContent;

    public C3pServerLogTask() {
    }

    public C3pServerLogTask(String c3pTaskId, ProcessInstance processInstance, Task task, String logContent) {
        this(c3pTaskId, processInstance.getWf_num(), task, logContent, processInstance.getParentSerialNo(), processInstance.getParentTaskId());
    }

    public C3pServerLogTask(String c3pTaskId, String scheduleId, Task task, String logContent, int parentSerialNo, int parentWfTaskId) {
        this.c3pTaskId = c3pTaskId;
        this.scheduleId = scheduleId;
        this.execId = parentSerialNo == 0 ? task.getSerialNo() : parentSerialNo;
        this.processId = task.getProcessId();
        this.processExecId = task.getSerialNo();
        this.activityId = task.getCurrActId();
        this.activityExecId = task.getTaskId();
        this.parentActivityExecId = parentWfTaskId;
        this.currentUser = task.getCurrDealer();
        this.dbTime = new Date();
        this.logContent = logContent;
    }

    public int getLogId() {
        return logId;
    }

    public void setLogId(int logId) {
        this.logId = logId;
    }

    public String getC3pTaskId() {
        return c3pTaskId;
    }

    public void setC3pTaskId(String c3pTaskId) {
        this.c3pTaskId = c3pTaskId;
    }

    public String getScheduleId() {
        return scheduleId;
    }

    public void setScheduleId(String scheduleId) {
        this.scheduleId = scheduleId;
    }

    public int getExecId() {
        return execId;
    }

    public void setExecId(int execId) {
        this.execId = execId;
    }

    public int getProcessId() {
        return processId;
    }

    public void setProcessId(int processId) {
        this.processId = processId;
    }

    public int getProcessExecId() {
        return processExecId;
    }

    public void setProcessExecId(int processExecId) {
        this.processExecId = processExecId;
    }

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public int getActivityExecId() {
        return activityExecId;
    }

    public void setActivityExecId(int activityExecId) {
        this.activityExecId = activityExecId;
    }

    public int getParentActivityExecId() {
        return parentActivityExecId;
    }

    public void setParentActivityExecId(int parentActivityExecId) {
        this.parentActivityExecId = parentActivityExecId;
    }

    public String getCurrentUser() {
        return currentUser;
    }

    public void setCurrentUser(String currentUser) {
        this.currentUser = currentUser;
    }

    public Date getDbTime() {
        return dbTime;
    }

    public void setDbTime(Date dbTime) {
        this.dbTime = dbTime;
    }

    public String getLogContent() {
        return logContent;
    }

    public void setLogContent(String logContent) {
        this.logContent = logContent;
    }
}
